﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Profile;

namespace WebSite.cn
{
    public partial class products_detfrm3 : System.Web.UI.Page
    {
        // Fields
    public string peimsg = "";

    // Methods
    private void Bind()
    {
        int num = 0;
        DataTable table = SQLAccess.GreatDs("select DB_Propei.proids,DB_Shoppro.promsg,DB_Shoppro.proname,DB_Shoppro.proprice1,DB_Shoppro.typeid,DB_Shoppro.propic2 from DB_Propei inner join DB_Shoppro on DB_Shoppro.proid=DB_Propei.proids where DB_Propei.proid=" + base.Request.QueryString["pid"].ToString() + " ").Tables[0];
        if (table.Rows.Count > 0)
        {
            foreach (DataRow row in table.Rows)
            {
                this.peimsg = this.peimsg + "<td><table width='320' height='108' border='0' cellpadding='5' cellspacing='0' class='border_02'><tr>";
                string peimsg = this.peimsg;
                this.peimsg = peimsg + "<td width='100' rowspan='2' align='center'><a href=products_details.aspx?typeid=" + row["typeid"].ToString() + "&pid=" + row["proids"].ToString() + " target='_parent'><img src='../uploadfile/product/" + row["propic2"].ToString() + "' /></a></td>";
                string str3 = this.peimsg;
                this.peimsg = str3 + "<td width='200' height='25' align='left'><a href=products_details.aspx?typeid=" + row["typeid"].ToString() + "&pid=" + row["proids"].ToString() + " target='_parent'>" + row["proname"].ToString() + "</a></td></tr><tr>";
                this.peimsg = this.peimsg + "<td align='left' valign=top>" + row["promsg"].ToString() + "</td></tr>";
                this.peimsg = this.peimsg + "</table></td>";
                num++;
                if ((num % 2) == 0)
                {
                    this.peimsg = this.peimsg + "</tr><tr><td colspan=2 height=5></td></tr><tr>";
                }
            }
        }
        else
        {
            this.peimsg = "暂无产品配件!";
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!base.IsPostBack && (base.Request.QueryString["pid"] != null))
        {
            this.Bind();
        }
    }

}

    
}